<template>
  <div class="list">
    <router-link to="/register" tag="div" class="listitem register" @click="logout">注册</router-link>
    <div class="listitem logout" @click="logout">退出登录</div>
  </div>
</template>

<script>
export default {
  name: "MyList",
  methods: {
    // logout() {
    //   if (localStorage.userMsg != "") {
    //     localStorage.userMsg = "";
    //     this.$router.go(0);
    //   }
    // }
    logout() {
      if ($cookies.isKey('userMsg')) {
        $cookies.remove('userMsg')
        this.$router.go(0);
      }
    }
  }
};
</script>
<style lang="scss" scoped>
@import "~styles/varibles.styl";
.list {
  position: relative;
  overflow: hidden;
  width: 100vw;
  height: 50vh;
  display: flex;
  -webkit-justify-content: space-around;
  justify-content: space-around;
  flex-direction: column;
  align-items: center;
  .listitem {
    width: 40vw;
    height: 15vw;
    text-align: center;
    line-height: 15vw;
    border-radius: 0.5rem;
    font-size: 0.3rem;
    font-weight: bold;
    box-shadow: 0.05rem 0.05rem 0.1rem #444;

  }
  .register{
    background: burlywood;
  }
  .logout{
    background: rgb(241, 70, 64);
  }
}
</style>
